import { lazy } from 'react'
import { createHashRouter } from 'react-router-dom'

const Login = lazy(() => import('@/views/Login'))
const MyLayout = lazy(() => import('@/views/Layout'))
const NotFound = lazy(() => import('@/views/NotFound'))
// const User = lazy(() => import('@/views/User'))
// const Swiper = lazy(() => import('@/views/Swiper'))
// const Goods = lazy(() => import('@/views/Goods'))
// const Echarts = lazy(() => import('@/views/Visible/echarts'))
// const EchartsThird = lazy(() => import('@/views/Visible/echarts-third'))
// const Editor = lazy(() => import('@/views/Editor'))
// const Baidu = lazy(() => import('@/views/Map/baidu'))
// const BaiduMap = lazy(() => import('@/views/Map/baidu-third'))

import Auth from '@/auth/Auth'

const router = createHashRouter([
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/',
    element: (
      <Auth>
        <MyLayout />
      </Auth>
    )
    // children: [
    //   {
    //     path: 'user/list',
    //     element: <User />
    //   },
    //   {
    //     path: 'swiper/list',
    //     element: <Swiper />
    //   },
    //   {
    //     path: 'goods/list',
    //     element: <Goods />
    //   },
    //   {
    //     path: 'visible/echarts',
    //     element: <Echarts />
    //   },
    //   {
    //     path: 'visible/echarts-third',
    //     element: <EchartsThird />
    //   },
    //   {
    //     path: 'editor/submit',
    //     element: <Editor />
    //   },
    //   {
    //     path: 'map/baidu',
    //     element: <Baidu />
    //   },
    //   {
    //     path: 'map/baidu-third',
    //     element: <BaiduMap />
    //   }
    // ]
  },
  {
    path: '*',
    element: <NotFound />
  }
])

export default router
